import http from '../index';
const PART_PATH = '/admin/config';

export const getConfig = (configName: string) => {
  let path = PART_PATH;
  if (configName === 'running-limit') {
    path += '/tasks/running-limit';
  } else {
    path += `/paths/${configName}`;
  }
  return http.get(path);
};

export const putConfig = (configName: string, data: string) => {
  let path = PART_PATH;
  if (configName === 'running-limit') {
    path += '/tasks/running-limit';
  } else {
    path += `/paths/${configName}`;
  }
  return http.put(path, data);
};
